package com.itheima.common;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class UserResult<T> implements Serializable {
    @ApiModelProperty(value = "响应状态码")
    private Integer code;
    @ApiModelProperty(value = "响应信息")
    private String msg;
    @ApiModelProperty(value = "响应数据")
    private T data;
    @ApiModelProperty(value = "角色id")
    private List<Long> roleIds;
    @ApiModelProperty(value = "岗位id")
    private List<Long> postIds;
    @ApiModelProperty(value = "角色数据")
    private List roles;
    @ApiModelProperty(value = "岗位数据")
    private List posts;

    public UserResult() {
    }

    public UserResult(Integer code, String msg, List roles, List posts) {
        this.code = code;
        this.msg = msg;
        this.roles = roles;
        this.posts = posts;
    }

    public UserResult(Integer code, String msg, T data, List<Long> roleIds, List<Long> postIds, List roles, List posts) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.roleIds = roleIds;
        this.postIds = postIds;
        this.roles = roles;
        this.posts = posts;
    }
}
